package com.jzlw.huozhuduan.ui.activity;

import android.os.Bundle;
import android.view.View;

import androidx.viewpager.widget.ViewPager;

import com.chaychan.library.BottomBarItem;
import com.chaychan.library.BottomBarLayout;
import com.jzlw.huozhuduan.R;
import com.jzlw.huozhuduan.base.BaseActivity;

import butterknife.BindView;
import butterknife.OnClick;

/*
 * 主页activity
 *
 * */
public class MainActivity extends BaseActivity {

    @BindView(R.id.vp_content)
    ViewPager vpContent;
    @BindView(R.id.bbl)
    BottomBarLayout bbl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected int setLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    protected void initdata() {
        vpContent.setAdapter(new MyAdapter(getSupportFragmentManager()));
        bbl.setViewPager(vpContent);
        bbl.setSmoothScroll(true);
        bbl.setOnItemSelectedListener(new BottomBarLayout.OnItemSelectedListener() {
            @Override
            public void onItemSelected(BottomBarItem bottomBarItem, int previousPosition, int currentPosition) {

            }


        });


    }

    @OnClick({R.id.vp_content, R.id.bbl})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.vp_content:
                break;
            case R.id.bbl:
                break;
        }
    }
}
